﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL_Class
{
  public class Menubar
    {
      NLLDataContext db = new NLLDataContext();
      public string AddNewMenu(Menu me) 
      {
          
          string result = string.Empty;
          try
          {
              var zz = db.sp_Menu_AddNew(me.Name, me.ParrentID, me.Position, me.SortNumber, me.Status, me.MetaTitle, me.MetaDescription, me.MetaKeywords, me.MetaRobots, me.MetaAuthor);

              result = "Thêm mới thành công";
          }
          catch (Exception ex)
          {
              throw ex;
          }
          return result;
      }

      public string UpdateMenu(Menu me) 
      {
          string result = string.Empty;
          try{
          var zz = db.sp_Menu_Update(me.ID,me.Name, me.ParrentID, me.Position, me.SortNumber, me.Status, me.MetaTitle, me.MetaDescription, me.MetaKeywords, me.MetaRobots, me.MetaAuthor);

          result = "Cập nhật thành công";
            }
          catch (Exception ex)
          {
              throw ex;
          }
          return result;
      }
      public void DeleteMenu(int id) 
      {try{
          var a = db.sp_Menu_Delete(id);
            }
          catch (Exception ex)
          {
              throw ex;
          }
      }
    }
}
